import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {

        int num;
        Scanner sc = new Scanner(System.in);

        num = sc.nextInt();
        Peron[] perons = new Peron[num];
        for (int i = 0; i < num; i++) {

            String name = sc.next();
            int age = sc.nextInt();
            perons[i] = new Peron(age, name);
           System.out.println( perons[i].toString());
        }
        String names = sc.next();
        int j = 0;
        int g=0;
        for (Peron peron : perons) {



            if (peron.name.equals(names)) {
                j = 1;
                System.out.println("查询结果：");
                System.out.println( perons[g].toString());
            }
g=g+1;
        }
        if (j == 0) {
            System.out.println("not found");

        }
    }}
class  Peron{
    int age;
    String name;

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    public Peron(int age , String name ) {
        this.age = age;
        this.name = name;
    }

    public Peron() {
    }
    @Override
    public String toString() {
        return "Person [name=" + name + ", age=" + age + "]";

    }
}